<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<style>
	input,select{
		margin-top: 1rem;
	}
</style>
<body style="text-align: center;">
<form action="UpdateProduct" method="post">
<input type="hidden" name="id" value="${product.id }" />
商品名称：<input type="text" name="name" value="${product.name }"/><br></br>
商品价格：<input type="text" name="price" value="${product.price }"/><br></br>
商品数量：<input type="text" name="num" value="${product.num }"/><br></br>
商品类型：<select name="tid">
<c:forEach items="${types }" var="type">
	<c:if test="${type.id==product.tid }">
		<option value="${type.id }">${type.name }</option>
	</c:if>
</c:forEach>
<c:forEach items="${types }" var="type">
	<c:if test="${type.id!=product.tid }">
		<option value="${type.id }">${type.name }</option>
	</c:if>
</c:forEach>
</select><br></br>
<input type="submit" value="修改"/>
</form>
</body>
</html>